#include <iostream>
#include <fstream>
#include <vector>

using namespace std;

struct Square
{
    int top, right, bottom, left;
    int availCount;  // in case some squares contain the same data

    bool operator==(Square& s)
    {
        return (top == s.top && right == s.right && bottom == s.bottom && left == s.left);
    }
}; 
vector<Square> squares;
vector<int> board;
int n;

void addNewSquare(Square& square);

bool roughJudge();
bool findSolution();
bool check();

//#define READ_FILE

int main()
{
#ifdef READ_FILE
    ifstream readIn("1008.input");
	if (!readIn)
	{
		readIn.open("../1008.input");
	}
#else
#define readIn cin
#endif

    int count = 0;

    while (true)
    {
        readIn >> n;
        if (n == 0)
        {
            break;
        }
        squares.clear();
        board.clear();

        Square square;
        square.availCount = 1;
        for (int i = 0; i < n * n; i++)
        {
            readIn >> square.top
                >> square.right
                >> square.bottom
                >> square.left;
            addNewSquare(square);
        }

        count++;

        bool res = roughJudge();
        if (res)
        {
            res = findSolution();
        }

        if (count != 1)
        {
            cout << endl;
        }

        cout << "Game " << count << ": ";
        if (res)
        {
            cout << "Possible" << endl;
        }
        else
        {
            cout << "Impossible" << endl;
        }
    }

#ifdef READ_FILE
    readIn.close();
#endif

    return 0;
}

void addNewSquare(Square& square)
{
    for (int i = 0; i < squares.size(); i++)
    {
        if (square == squares[i])
        {
            squares[i].availCount++;
            return;
        }
    }
    squares.push_back(square);
}

bool roughJudge()
{
    int left_right_noMatch[10] = {0};
    int top_bottom_noMatch[10] = {0};
    for (int i = 0; i < squares.size(); i++)
    {
        left_right_noMatch[squares[i].left] += squares[i].availCount;
        left_right_noMatch[squares[i].right] -= squares[i].availCount;
        top_bottom_noMatch[squares[i].top] += squares[i].availCount;
        top_bottom_noMatch[squares[i].bottom] -= squares[i].availCount;
    }

    int left_noMatch_count = 0;
    int right_noMatch_count = 0;
    int top_noMatch_count = 0;
    int bottom_noMatch_count = 0;
    
    for (int i = 0; i < 10; i++)
    {
        left_noMatch_count += (left_right_noMatch[i] > 0) ? left_right_noMatch[i] : 0;
        right_noMatch_count += (left_right_noMatch[i] < 0) ? -left_right_noMatch[i] : 0;
        top_noMatch_count += (top_bottom_noMatch[i] > 0) ? top_bottom_noMatch[i] : 0;
        bottom_noMatch_count += (top_bottom_noMatch[i] < 0) ? -top_bottom_noMatch[i] : 0;
    }

    if (left_noMatch_count > n ||
        right_noMatch_count > n ||
        top_noMatch_count > n ||
        bottom_noMatch_count > n)
    {
        return false;
    }

    return true;
}


bool findSolution()
{
    board.push_back(0);
    int squareCount = squares.size();
    int maxBoardSize = n * n;
    
    while (board[0] < squareCount)
    {
        int curr = board.size() - 1;
        if (board[curr] == squareCount)
        {
            board.pop_back();
            board[--curr]++;
            continue;
        }
        if (check())
        {
            if (curr == maxBoardSize - 1)
            {
                return true;
            }
            else
            {
                board.push_back(0);
            }
        }
        else
        {
            board[curr]++;
        }
    }

    return false;
}

bool check()
{
    int curr = board.size() - 1;

    // check if the square is available
    int squareIndex = board[curr];
    int count = 0;
    for (int i = 0; i <= curr; i++)
    {
        if (board[i] == squareIndex)
        {
            count++;
        }
    }
    if (count > squares[squareIndex].availCount)
    {
        return false;
    }


    Square* currSquare = &squares[board[curr]];

    // left
    if (curr % n >= 1)
    {
        Square* leftSquare = &squares[board[curr-1]];
        if (leftSquare->right != currSquare->left)
        {
            return false;
        }
    }

    // top
    if (curr >= n)
    {
        Square* topSquare = &squares[board[curr-n]];
        if (topSquare->bottom != currSquare->top)
        {
            return false;
        }
    }

    return true;
}



